<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>专家介绍</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<meta name="format-detection" content="address=no"/>
<link href="__PUBLIC__/css/base.css" rel="stylesheet"/>
</head>
<body class="huibg">
<!---  头部开始  -->
<div class="top clearfix">
	<div class="icon_left"></div>
	<div class="icon_right"></div>
</div>
<!---  头部结束  -->
<div class="yqzj_info yqzj2 cssss">	
	<div class="box">
		<img src="{$userinfo.headimg}" />
		<div class="text">
			<p>
				<span>姓    名：</span>
				<span class="name">{$userinfo.name}</span>
			</p>
			<p>
				<span>工作单位：</span>
				<span>{$userinfo.hospital}</span>
			</p>
			<p>
				<span>工作科室：</span>
				<span>{$userinfo.department}</span>
			</p>
			<p>
				<span>职     称：</span>
				<span>{$userinfo.position}</span>
			</p>
			<p>
				<span>社会职务：</span>
				<span>{$userinfo.socialposition}</span>
			</p>
		</div>		
	</div>
	<div class="buy_box">
		<a class="take">
			<p class="hl1">订阅：  ￥  <span>{$subprice}</span>  元/月</p>
			<p>每月订阅 4 篇病例</p>
		</a>
		<a class="history">
			<p class="hl1">购买历史病例：  ￥  <span>{$userinfo.packageprice}</span>  元</p>
			<p>单个病例为￥ {$recordprice} 元</p>
		</a>
	</div>
	<div class="box_08">
		<div class="title">简历<i></i></div>
		<p>{$userinfo.resume}</p>
	</div>
	<div class="box_08 list_01">
		<div class="title">病例展示</div>
	</div>
	<a class="more">获取更多</a>
</div>
<!-- 订阅支付  开始 -->
<div class="yqzj_info bl_info dyzf cssss none">
	<div class="box_02">
		<div class="title_01">
			<span>医生信息</span>
		</div>
		<div class="box_03 shou">
			<img src="{$userinfo.headimg}">
			<div class="text">
				<p>
					<span>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</span>
					<b class="name">{$userinfo.name}</b>
				</p>
				<p>
					<span>工作单位：</span>
					<b>{$userinfo.hospital}</b>
				</p>
				<p>
					<span>工作科室：</span>
					<b>{$userinfo.department}</b>
				</p>
				<p>
					<span>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</span>
					<b>{$userinfo.position}</b>
				</p>
				<p>
					<span>社会职务：</span>
					<b>{$userinfo.socialposition}</b>
				</p>
			</div>
		</div>
	</div>
	<div class="box_02 bt5">
		<div class="title_01">
			<span>订阅时限</span>
		</div>
		<div class="box_03 shou">
			<div class="box_04 month">
				<b>月  数：</b>
				<span>1  个月</span>
				<i class="jiantou4"></i>
			</div>
			<div class="box_04 bde blNum">
				<b>病例数：</b>
				<span>4 个</span>
			</div>
		</div>
	</div>
	<div class="accounts_box">
		<span>合计：</span>
		<span class="money">￥0.00</span>
		<a class="account">结算</a>
	</div>
</div>
<!-- 订阅支付  结束 -->
<!-- 购买历史病历  开始 -->
<div class="js cssss none">
	<div  class="box_06">
		<div class="title">支付费用</div>
		<div class="box_07">支付费用：<span class="mnns">￥<em>600</em>.00</span></div>
	</div>
	<div  class="box_06">
		<div class="title">金豆使用</div>
		<div class="box_07">
			<div class="text_1">当前金豆数：<span class="point_sum">{$points}</span>个</div>
		</div>
		<div class="box_07">
			<div class="text_1">使用金豆数：<span class="use_point" >0</span>个</div>
			<div class="text_2">
				<i class="jian"></i>
				<input class="pointNum" type="text" value="0" readonly="readonly"/>
				<i class="jia"></i>
			</div>
		</div>
		<div class="box_07">
			<div class="text_1">使用金豆为100的整数倍</div>
			<div class="text_2">抵<span class="mons">￥<em>0</em>.00</span></div>
		</div>
		<div class="box_09">合计：<span class="payNum">￥<em>00</em>.00</span></div>
	</div>
	<div  class="box_06">
		<div class="title">请选择支付方式：</div>
		<div class="box_010 wei_zhi"><span>微信支付</span><i></i></div>
	</div>
	<div class="bott2">
		<a class="yes">确定支付</a>
	</div>
</div>
<!-- 购买历史病历  结束 -->
<!---  订阅 提示框开始  -->
<div class="reminder_box take_box none">
	<div class="reminderBox_bg"></div>
	<div class="reminderBox_text">
		<!--
		<p>您是否确定订阅XXX专家的病例？</p>
		<p>如确定订阅，您所订阅的病例将从下个月开始。订阅后，只有在订阅期结束1月后没有达到订阅病例数量时，系统才予以退费处理。如有问题请咨询客服。</p>
		<p>感谢您的订阅~</p>
		<a class="invite2"><span>确 定</span></a>
		<a class="confirm2"><span>取 消</span></a>
		-->
	</div>
</div>
<!---  订阅 提示框结束  -->
<!---  购买 提示框开始  -->
<div class="reminder_box buy_ing_box none">
	<div class="reminderBox_bg"></div>
	<div class="reminderBox_text">
		<!--
		<p>XXX专家的病例：<i>￥10.00</i></p>
		<p>单个病例购买后，系统无法退订！</p>
		<p>您是否确定购买此病例?<br>如有问题请咨询相关客服，感谢您的购买~</p>
		<a class="invite2" href="dyzf.html"><span>确 定</span></a>
		<a class="confirm2"><span>取 消</span></a>
		-->
	</div>
</div>
<!---  购买 提示框结束  -->
<!---  购买 历史 提示框开始  -->
<div class="reminder_box buyHis_box none">
	<div class="reminderBox_bg"></div>
	<div class="reminderBox_text">
		<!--
		<p>XXX专家的病例：<i>￥50.00</i></p>
		<p>单个病例购买后，系统无法退订！</p>
		<p>您是否确定购买此病例?<br>如有问题请咨询相关客服，感谢您的购买~</p>
		<a class="invite2" href="dyzf.html"><span>确 定</span></a>
		<a class="confirm2"><span>取 消</span></a>
		-->
	</div>
</div>
<!---  购买 提示框结束  -->
<!---  订阅时限 开始  -->
<div class="fc_box month_box none">
	<div class="fcBox_bg"></div>
	<div class="fcBox_text">
		<dl>
			<dt>选择月数：<span class="close3" onclick="close3(this);"></span></dt>
			<dd>1</dd>
			<dd>2</dd>
			<dd>3</dd>
			<dd>4</dd>
			<dd>5</dd>
			<dd>6</dd>
			<dd>7</dd>
			<dd>8</dd>
			<dd>9</dd>
			<dd>10</dd>
			<dd>11</dd>
			<dd>12</dd>
		</dl>
	</div>
</div>
<!---  订阅时限 结束  -->
</body>
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/comm.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
var pageSize=5;//每页多少条
var pageIndex=0;//初始化第0页
var userid={$userinfo.id};
var free;
function getlist(){
	var new_element;
	var new_element1;
	$.post('__URL__/yqzj_info2_page',{
		pageSize:pageSize,
		pageIndex:pageIndex,
		userid:userid
	},function(e){
		if(null==e){
			$(".more").text('没有数据');
			return;
		}
		if(e.length<pageSize){
			$(".more").text('已经是最后一页');
		}
		$.each(e,function(k,v){
			//v.id,ID
			//v.image,小图片
			//v.major,专业
			//v.diagnostic,诊断
			//v.praise,点赞
			//<a>__URL__/bl_info</a>
			if (v.cashtype ==1) {
				new_element='<a class="list1" href="__URL__/bl_info/id/'+v.rec_id+'">'+
					'<img src="'+v.image+'">'+
					'<div class="text">'+
						'<p>'+
							'<b>专业：</b>'+
							'<span>'+v.major+'</span>'+
						'</p>'+
						'<p>'+
							'<b>诊断：</b>'+
							'<span class="zhenduan">'+v.diagnostic+'</span>'+
						'</p>'+				
					'</div>'+
					'<p class="zljh">'+
						'<b>治疗计划和治疗：</b>'+
						'<span>'+v.tp+'</span>'+
					'</p>'+
					'<p class="size2"><span class="free">免费</span></p>'+
				'</a>';
			}else if (v.cashtype==2) {
				if(v.isBuy==1){
					new_element='<a class="list1" href="__URL__/bl_info/id/'+v.id+'">'+
						'<img src="'+v.image+'">'+
						'<div class="text">'+
							'<p>'+
								'<b>专业：</b>'+
								'<span>'+v.major+'</span>'+
							'</p>'+
							'<p>'+
								'<b>诊断：</b>'+
								'<span class="zhenduan">'+v.diagnostic+'</span>'+
							'</p>'+				
						'</div>'+
						'<p class="zljh">'+
							'<b>治疗计划和治疗：</b>'+
							'<span>'+v.tp+'</span>'+
						'</p>'+
						'<p class="size2"><span class="buys">已购买</span></p>'+
					'</a>';
				}else{
					new_element='<div class="list1">'+
						'<img src="'+v.image+'">'+
						'<div class="text">'+
							'<p>'+
								'<b>专业：</b>'+
								'<span>'+v.major+'</span>'+
							'</p>'+
							'<p>'+
								'<b>诊断：</b>'+
								'<span class="zhenduan">'+v.diagnostic+'</span>'+
							'</p>'+				
						'</div>'+
						'<p class="zljh">'+
							'<b>治疗计划和治疗：</b>'+
							'<span>'+v.tp+'</span>'+
						'</p>'+
						'<p class="size2 buyss"><span class="buy_ing" onclick="buy_ing();">购买：￥<em>'+v.recordprice +'</em> 元</span></p>'+
					'</a>';
				}
			}			
			
			$(".list_01").append(new_element);
		});
		pageIndex++;//当前计数加
	});
}
getlist();
$(".more").on("click",function(){
	getlist();
});
$(".box_08 .title").click(function(){
	if($(this).find("i").hasClass("check")){
		$(this).find("i").removeClass("check");
		$(this).next().removeClass("none");
	}else{
		$(this).find("i").addClass("check");
		$(this).next().addClass("none");
	}	
});
var nonceStr = '{$nonceStr}';
var timestamp = {$timestamp};
var signature = '{$signature}';
var detail=[{}];
var fee;
var points=0;
var limit=1;//订阅月数
var limit_num=limit*4;//订阅病例个数
var totalfee;//总钱数
var expertname="{$userinfo.name}";
var paytype;//付款类型
var pointNum=0;//抵扣金豆数
var payNum;//应付钱数
var mons=0;;//抵扣钱数
var point_sum;//当前金豆数
//订阅
$(".take").live("click",function(){	
	fee=$(".take .hl1 span").html();	
	fee=parseInt(fee);
	points=0;
	limit=1;
	paytype=2;
	totalfee=fee*limit;
	$(".accounts_box .money").html("￥"+totalfee+".00");
	$(this).parents(".yqzj2").addClass("none");
	$(".dyzf").removeClass("none");
});
//购买历史
$(".history").live("click",function(){
	fee=$(".history .hl1 span").html();	
	fee=parseInt(fee);
	totalfee=fee;
	paytype=3;

	$(".payNum em").html(totalfee);
	$(".mnns em").html(totalfee);
	$(this).parents(".yqzj2").addClass("none");
	$(".js").removeClass("none");
});
//购买病例
function buy_ing(){
	fee=$(".buy_ing em").html();	
	fee=parseInt(fee);
	totalfee=fee;
	paytype=1;

	$(".payNum em").html(totalfee);
	$(".mnns em").html(totalfee);
	$(".yqzj2").addClass("none");
	$(".js").removeClass("none");
	//$(".buy_ing_box").removeClass("none");
};
//取消
/*
$(".confirm2").click(function(){
	$(this).parents(".reminder_box").addClass("none");
});
*/
  //DEMO DATA
        //<=====================================================>
        // $paytype=1;//单份病例
        // $detail='[{"id":1,"fee":100,"points":100}]';//病例ID
        // $totalfee=100;
        // $points=100;
        //<=====================================================>
        // $paytype=2;//订阅整月病例
        // $detail='[{"id":1,"fee":100,"points":100,"limit":4}]';//专家的ID LIMIT：订阅多少个月
        // $totalfee=100;
        // $points=100;
        //<=====================================================>
        // $paytype=3;//订阅打包病例
        // detail='[{"id":1,"fee":100,"points":100}]';//专家的ID
        // $totalfee=100;
        // $points=100;
//订阅月数
$(".month").click(function(){
	$(".month_box").removeClass("none");
});
//订阅月数 选择
$(".month_box dd").click(function(){
	limit=$(this).html();
	limit_num=limit*4;
	totalfee=fee*limit;
	$(".month span").html(limit+" 个月");
	$(".blNum span").html(limit_num+" 个");
	$(".accounts_box .money").html("￥"+totalfee+".00");
	$(".month_box").addClass("none");
});
//订阅整月 结算
$(".dyzf .account").click(function(){
	detail=[{"id":userid,"fee":fee,"points":points,"limit":limit}];
	detail=JSON.stringify(detail);
	$.post('__URL__/wxPay',{
		paytype:paytype,
		totalfee:totalfee,
		points:points,
		detail:detail,
		tips: 'takeBox_text',
		expertname:expertname
	},function(e){
		$(".take_box").removeClass("none");
		$(".take_box .reminderBox_text").html(e)
	});
});
//加
$(".jia").click(function(){	
	point_sum=parseInt($(".point_sum").html());
	mons=parseInt($(".mons em").html());
	if(totalfee==0){
		alert("金豆数量已够");
		return;
	}
	//alert(point_sum);
	if(point_sum<100){
		alert("金豆数量不够");
		return;
	}else{
		pointNum+=100;
		$(".pointNum").val(pointNum);
	}	
	totalfee-=1;
	mons=parseInt(pointNum/100);
	point_sum=parseInt(point_sum)-100;	
	payNum=totalfee;
	points=pointNum;
	$(".use_point").html(pointNum);	
	$(".point_sum").html(point_sum);
	$(".mons em").html(mons);
	$(".payNum em").html(payNum);	
});
//减
$(".jian").click(function(){
	point_sum=parseInt($(".point_sum").html());
	mons=parseInt($(".mons em").html());
		
	if(pointNum<1){
		alert("金豆数已经为0");
		return;
	}
	
	pointNum-=100;
	totalfee+=1;
	mons=parseInt(pointNum/100);
	point_sum=parseInt(point_sum)+100;	
	payNum=totalfee+mons;
	points=pointNum;
	$(".use_point").html(points);	
	$(".point_sum").html(point_sum);
	$(".mons em").html(mons);
	$(".payNum em").html(totalfee);
	$(".pointNum").val(pointNum);
	
});
//选择微信支付
$(".wei_zhi").click(function(){
	if ($(this).hasClass("check")) {
		$(this).removeClass("check");
	}else{
		$(this).addClass("check");
	}
});
//购买  确定支付
$(".js .yes").click(function(){
	var tips;
	if($(".wei_zhi").hasClass("check")){
		detail=[{"id":userid,"fee":fee,"points":points}];
		if(paytype==1){
			tips="buyIng_text";
		}else if(paytype==3){
			tips="buyHis_text";
		}
		detail=JSON.stringify(detail);
		$.post('__URL__/wxPay',{
			nonceStr:nonceStr,
			timestamp:timestamp,
			signature:signature,
			paytype:paytype,
			totalfee:totalfee,
			points:points,
			detail:detail,
			tips: tips,
			expertname:expertname
		},function(e){
			if(paytype==1){
				$(".buy_ing_box").removeClass("none");
				$(".buy_ing_box .reminderBox_text").html(e)
			}else if(paytype==3){
				$(".buyHis_box").removeClass("none");
				$(".buyHis_box .reminderBox_text").html(e)
			}			
		});
		
	}else{
		alert("请选择支付方式");
		return;
	}	
});

</script>
</html>